<?php
namespace app\api\model;
use think\Model;
use think\Log;

class User extends Model{
    public function Clogin($data){
        try {
            $where=array('telphone'=>$data['telphone']);
            $password=md5($data['password']);
            //首先根据=手机号进行查询是否存在账户
            $res=$this->where($where)->find();
            if($res){
                if($res['password']==$password){
                    return 1;
                }else{
                    return 0;
                }
            }else{
                return 0;
            }
        }catch (\think\Exception $e){
            Log::write('login exception'.$e->getMessage());
        }
    }
    
}